﻿<UserControl
	x:Class="DeltaEngine.Editor.InputEditor.InputEditorView"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:inputEditor="clr-namespace:DeltaEngine.Editor.InputEditor"
	HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
	d:DesignHeight="600" d:DesignWidth="400" MinWidth="300"
	mc:Ignorable="d"
	d:DataContext="{d:DesignInstance Type=inputEditor:InputEditorDesign,
		IsDesignTimeCreatable=True}">

	<UserControl.Resources>

		<Style TargetType="Label" x:Key="DeltaLabel">
			<Setter Property="FontSize" Value="16" />
			<Setter Property="FontFamily" Value="Arial" />
			<Setter Property="FontStyle" Value="Normal" />
			<Setter Property="Background" Value="#e2e2e2" />
			<Setter Property="Foreground" Value="#FF5D5D5D" />
		</Style>

		<Style TargetType="TextBox" x:Key="DeltaTextBox">
			<Setter Property="FontSize" Value="16" />
			<Setter Property="FontFamily" Value="Arial" />
			<Setter Property="FontStyle" Value="Normal" />
			<Setter Property="Background" Value="#FFFBFBFB" />
			<Setter Property="Foreground" Value="#FF5D5D5D" />
			<Setter Property="BorderBrush" Value="{x:Null}" />
		</Style>

		<Style TargetType="ComboBox" x:Key="DeltaComboBox">
			<Setter Property="FontSize" Value="16" />
			<Setter Property="FontFamily" Value="Arial" />
			<Setter Property="FontStyle" Value="Normal" />
			<Setter Property="Background" Value="#FFFBFBFB" />
			<Setter Property="Foreground" Value="#FF5D5D5D" />
		</Style>

		<Style TargetType="ListBox" x:Key="DeltaListBox">
			<Setter Property="FontSize" Value="16" />
			<Setter Property="FontFamily" Value="Arial" />
			<Setter Property="FontStyle" Value="Normal" />
			<Setter Property="Background" Value="#FFFBFBFB" />
			<Setter Property="Foreground" Value="#FF5D5D5D" />
		</Style>

		<Style TargetType="Button" x:Key="DeltaButton">
			<Setter Property="FontSize" Value="16" />
			<Setter Property="FontFamily" Value="Arial" />
			<Setter Property="FontStyle" Value="Normal" />
			<Setter Property="Background" Value="#FF9C9C9C" />
			<Setter Property="Foreground" Value="#FFFFFFFF" />
		</Style>

	</UserControl.Resources>

	<Grid Background="#FFF4F4F4">
		<Grid.RowDefinitions>
			<RowDefinition Height="12" />
			<RowDefinition Height="30" />
			<RowDefinition Height="12" />
			<RowDefinition Height="30" />
			<RowDefinition Height="12" />
			<RowDefinition />
			<RowDefinition Height="12" />
			<RowDefinition Height="40" />
			<RowDefinition Height="12" />
		</Grid.RowDefinitions>
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="12" />
			<ColumnDefinition Width="28*" />
			<ColumnDefinition Width="8" />
			<ColumnDefinition Width="30" />
			<ColumnDefinition Width="20" />
			<ColumnDefinition Width="28*" />
			<ColumnDefinition Width="8" />
			<ColumnDefinition Width="30" />
			<ColumnDefinition Width="12" />
		</Grid.ColumnDefinitions>

		<Button 
			Content="+" Command="{Binding Path=AddCommand}" Grid.Column="3" Grid.Row="3" FontSize="24" 
			Foreground="White" Style="{StaticResource DeltaButton}" >
			<Button.Background>
				<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
					<GradientStop Color="#FFA6A6A6" Offset="0"/>
					<GradientStop Color="#FF979797" Offset="1"/>
				</LinearGradientBrush>
			</Button.Background>
		</Button>
		<Button 
			Content="+" Command="{Binding Path=AddTrigger}" Grid.Column="7" Grid.Row="3" FontSize="24" 
			Foreground="White" Style="{StaticResource DeltaButton}" >
			<Button.Background>
				<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
					<GradientStop Color="#FFA6A6A6" Offset="0"/>
					<GradientStop Color="#FFA6A6A6" Offset="1"/>
				</LinearGradientBrush>
			</Button.Background>
		</Button>
		<ListBox 
			ItemsSource="{Binding Path=CommandList, UpdateSourceTrigger=PropertyChanged}"
		  SelectedItem="{Binding Path=SelectedCommand}" Grid.Column="1" Grid.Row="5" Grid.ColumnSpan="3"
		  Style="{StaticResource DeltaListBox}" />
		<ListBox 
			ItemsSource="{Binding Path=TriggerList, UpdateSourceTrigger=PropertyChanged}"
		  SelectedItem="{Binding Path=SelectedTrigger}" Grid.Column="5" Grid.Row="5" Grid.ColumnSpan="3"
		  Style="{StaticResource DeltaListBox}" />
		<TextBox 
			Text="{Binding Path=NewCommand}" Grid.Column="1" Grid.Row="3" Style="{StaticResource DeltaTextBox}"
			VerticalContentAlignment="Center"/>
		<Label 
			Content="Command" Grid.Column="1" Style="{StaticResource DeltaLabel}" Grid.Row="1" Grid.ColumnSpan="3"
			VerticalContentAlignment="Center"/>
		<Label 
			Content="Trigger" Grid.Column="5" Style="{StaticResource DeltaLabel}" Grid.Row="1" Grid.ColumnSpan="3"
			VerticalContentAlignment="Center"/>
		<ComboBox 
			Grid.Column="5" Grid.Row="3" Style="{StaticResource DeltaComboBox}"
			ItemsSource="{Binding Path=AvailableTriggers}" VerticalContentAlignment="Center"
			SelectedItem="{Binding Path=SelectedTrigger}"/>
		<Button
			Grid.Column="5" Grid.Row="7" Grid.ColumnSpan="3" Content="Save" Click="Save" HorizontalAlignment="Right" 
			Width="100" FontSize="22" FontWeight="Bold" Foreground="White" Style="{StaticResource DeltaButton}" >
			<Button.Background>
				<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
					<GradientStop Color="#FFA6A6A6" Offset="0"/>
					<GradientStop Color="#FF979797" Offset="1"/>
				</LinearGradientBrush>
			</Button.Background>
		</Button>
	</Grid>
</UserControl>